<!DOCTYPE html>
<html>

<head>
    <!--#include virtual="/public/inc/head.html"-->
    <title>明源云客-小蜜蜂</title>
    <!--#include virtual="/public/inc/seajs.html" -->
    <style type="text/css">
        .tab {
            position: relative;
        }
        
        .tab .btn-group {
            position: absolute;
            right: 0;
            bottom: 4px;
        }
        
        .tab .btn-group .btn {
            color: #fff;
        }
        
        .tab .btn-group .btn:hover {
            color: #fff;
        }
        
        .active_list .fag {
            display: inline-block;
            background-color: #9797A6;
            color: #FFF;
            border-radius: 50px;
            font-size: 12px;
            width: 90px;
            text-align: center;
            vertical-align: middle;
        }
        
        .member_name {
            display: inline-block;
            width: 150px;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        
        .member_name_a {
            display: inline-block;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <!-- data-permission="50030601-00" data-func-codes="50030601"-->
    <!--#include virtual="/public/inc/top.html" -->
    <div class="container">
        <div class="wrap clearfix">
            <!--#include virtual="/public/inc/side.html" -->
            <!-- <div ng-hide="true" class="content content-loading"></div>-->

            <div class="content" ng-controller="MainController">
                <!--新增活动-->
                <div>
                    <div class="grid-header pl10 mt10 grid-header-left-line relative">
                        <div class="clearfix">
                            <span class="fl f14 lh30 text-indent">基本信息</span>
                        </div>
                        <div class="tab-bottom-line"></div>
                    </div>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="form-cell pt16" valign="top" width="88"><em class="c-red mr5">*</em>活动名称：</td>
                                <td class="pt12" valign="top">
                                    <input class="input-text" ng-model="activity.act_detail.act_name">
                                </td>
                            </tr>
                            <tr ng-if="!activityId" ng-cloak>
                                <td class="form-cell pt16" valign="top" width="88"><em class="c-red mr5">*</em>活动类型：</td>
                                <td class="pt12" valign="top">
                                    <div ui-combobox data="activity.act_type_list" text-field="type_name" value-field="type_id" ng-model="activity_type_id"
                                    class="w250"></div>
                                </td>
                            </tr>
                            <tr ng-if="activityId" ng-cloak>
                                <td class="form-cell pt16" valign="top" width="88"><em class="c-red mr5">*</em>活动类型：</td>
                                <td class="form-cell pt16" valign="top" ng-repeat="act_type in activity.act_type_list" ng-if="act_type.type_id == activity.act_detail.act_type_id" ng-cloak>{{act_type.type_name}}</td>
                            </tr>
                            <tr>
                                <td class="form-cell pt16" valign="top" width="88">&nbsp;&nbsp;&nbsp;拓客目标：</td>
                                <td class="pt12" valign="top">
                                    <input class="input-text w400 mr5" ng-model="activity.act_detail.target">人
                                </td>
                            </tr>
                            <tr>
                                <td class="form-cell pt16" width="88" valign="top"><em class="c-red mr5">*</em>活动时间：</td>
                                <td class="pt12" valign="top">
                                    <div class="fl clearfix ng-scope">
                                        <input type="text" class="input-text input-data fl" readonly="" id="start_date" ui-date="" format="yyyy-MM-dd HH:mm" max-date="#F{$dp.$D(\'end_date'\)}"
                                        ng-model="activity.act_detail.start_time">
                                        <span class="fl lh30">&nbsp;&nbsp;-&nbsp;&nbsp;</span>
                                        <input type="text" class="input-text input-data fl" readonly="" id="end_date" ui-date="" format="yyyy-MM-dd HH:mm" min-date="#F{$dp.$D(\'start_date'\)}"
                                        ng-model="activity.act_detail.end_time">

                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="form-cell pt16" valign="top" width="88"><em class="c-red mr5">*</em>活动地点：</td>
                                <td class="pt12" valign="top" colspan="3">
                                    <div class="fl select mr10 w400" ui-location location="activity.act_detail">
                                       
                                    </div>
                                    <input type="text" class="input-text fl" placeholder="街道/单位" style="width: 526px;" ng-model="activity.act_detail.address">
                                </td>
                            </tr>
                            <tr>
                                <td class="form-cell pt16" valign="top">&nbsp;&nbsp;&nbsp;备注：</td>
                                <td class="pt12" valign="top">
                                    <textarea class="textarea" ng-model="activity.act_detail.remark"></textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="grid-header pl10 mt10 grid-header-left-line relative">
                        <div class="clearfix">
                            <span class="fl f14 lh30 text-indent">活动设置</span>
                        </div>
                        <div class="tab-bottom-line"></div>
                    </div>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="form-cell pt16" valign="top" width="100"><em class="c-red mr5">*</em>是否发放礼品：</td>
                                <td valign="top" class="pt19">
                                    <div>
                                        <div class="radio fl" style="margin-right:50px">
                                            <input type="radio" name="line_state" id="present1" value="1" ng-model="activity.act_detail.is_send_present">
                                            <label for="present1">是</label>
                                        </div>
                                        <div class="radio fl">
                                            <input type="radio" name="line_state" id="present2" value="0" ng-model="activity.act_detail.is_send_present">
                                            <label for="present2">否</label>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="form-cell pt16" valign="top" width="220"><span class="fl"><em class="c-red mr5">* </em>是否要求客户关注营销公众号</span><i class="report-icon-help" style="margin-top:3px;"
                                                                                                                                 ui-tip="" url="dialog/tips1.html"></i>：</td>
                                <td class="pt12">
                                    <div>
                                        <div class="radio fl" style="margin-right:50px">
                                            <input type="radio" name="token_state" id="token1" value="1" 
                                            ng-change="activity.act_detail.is_reg_agent = +!+activity.act_detail.is_selected_mtoken" ng-model="activity.act_detail.is_selected_mtoken">
                                            <label for="token1">是</label>
                                        </div>
                                        <div class="radio fl">
                                            <input type="radio" name="token_state" id="token2" value="0" ng-model="activity.act_detail.is_selected_mtoken">
                                            <label for="token2">否</label>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr ng-cloak ng-show="activity.act_detail.is_selected_mtoken == 0">
                                <td class="form-cell pt16" valign="top" width="200"><span class="fl"><em class="c-red mr5">*</em>是否引导注册经纪人</span><i class="report-icon-help" style="margin-top:3px;"  ui-tip="" url="dialog/tips3.html"></i>：</td>
                                <td class="pt12">
                                    <div>
                                        <div class="radio fl" style="margin-right:50px">
                                            <input type="radio" name="reg_state" id="reg1" value="1" ng-model="activity.act_detail.is_reg_agent">
                                            <label for="reg1">是</label>
                                        </div>
                                        <div class="radio fl">
                                            <input type="radio" name="reg_state" id="reg2" value="0" ng-model="activity.act_detail.is_reg_agent">
                                            <label for="reg2">否</label>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr ng-cloak ng-show="activity.act_detail.is_selected_mtoken == 1">
                                <td class="form-cell pt16" valign="top" width="100"><em class="c-red mr5">*</em>营销公众号：</td>
                                <td class="pt12" valign="top">
                                    <div ui-combobox data="activity.token_list" text-field="wxname" value-field="token" ng-model="activity_token" class="w250"></div>
                                </td>
                            </tr>
                            <tr ng-cloak ng-show="activity.act_detail.is_selected_mtoken == 1">
                                <td class="form-cell pt16" valign="top" width="130"><span class="fl"><em class="c-red mr5">*</em>客户扫码注册图文</span><i class="report-icon-help" style="margin-top:3px;"
                                    ui-tip="" url="dialog/tips2.html"></i>：</td>
                                <td class="form-cell pt16" valign="top"><a class="c-blue" href="{{setImgInfoUrl}}" target="_blank">立即设置</a></td>
                            </tr>
                            <tr ng-cloak ng-show="activity.act_detail.is_reg_agent == 1 && activity.act_detail.is_selected_mtoken == 0">
                                <td class="form-cell pt16" valign="top" width="130"><span class="fl"><em class="c-red mr5">*</em>跳转公众号URL链接</span><i class="report-icon-help"
                                    style="margin-top:3px;" ui-tip="" url="dialog/tips4.html"></i>：</td>
                                <td class="form-cell pt12" valign="top">
                                    <input type="text" class="input-text" placeholder="请输入全民营销邀请经纪人注册页面URL" ng-model="activity.act_detail.public_number_url"
                                    />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="grid-header pl10 mt10 grid-header-left-line relative">
                        <div class="clearfix">
                            <span class="fl f14 lh30 text-indent">任务分配</span>
                            <a href="javascript:;" class="btn fr"
                                ui-dialog="新增任务"
                                ui-dialog-url="dialog/edit_assist.html"
                                ui-dialog-cache="false"
                                ui-dialog-init="taskViewer.init($dialogScope,$data)"
                                ui-dialog-ok="taskViewer.save($dialogScope,$dialog,$data)">新增任务</a>
                        </div>
                        <div class="tab-bottom-line"></div>
                    </div>
                    <div class="sheet mt10">
                        <table width="100%">
                            <thead>
                                <tr class="thead ta-l">
                                    <th height="34" width="50" style="text-align: center">
                                        序号
                                    </th>
                                    <th style="text-align: center" width="230">任务时间</th>
                                    <th style="text-align: center">任务地点</th>
                                    <th style="text-align: center" width="100">拓客目标</th>
                                    <th style="text-align: center" width="200">成员</th>
                                    <th style="text-align: center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="task in activity.task_detail" ng-cloak>
                                    <td height="34">{{$index + 1}}</td>
                                    <td>{{task.start_time}} — {{task.end_time}}</td>
                                    <td>{{task.province_name}}{{task.city_name}}{{task.district_name}}{{task.address}}</td>
                                    <td>{{task.target}}</td>
                                    <td>
                                        <p class="member_name">{{task.members}}</p>
                                        <a class="c-orange member_name_a" 
                                            ng-if="task.member_users.length"
                                            ui-dialog="查看成员" 
                                            ui-dialog-data="task"
                                            ui-dialog-cache="false"
                                            ui-dialog-url="dialog/member_view.html">查看</a>
                                    </td>
                                    <td>
                                        <a class="c-orange"
                                        ui-dialog="编辑任务"
                                            ui-dialog-url="dialog/edit_assist.html"
                                            ui-dialog-cache="false"
                                            ui-dialog-data="task"
                                            ui-dialog-init="taskViewer.init($dialogScope,$data)"
                                            ui-dialog-ok="taskViewer.save($dialogScope,$dialog,$data,$index)">编辑</a>
                                        <a href="javascript:;" title="删除" class="c-orange"
                                            ui-confirm="确定要删除任务吗？"
                                            ui-confirm-ok="deleteTask(task,$index)">删除</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="text-center mt25">
                        <a href="javascript:;" class="btn" ng-click="save()">保存</a>
                        <a href="javascript:;" class="btn btn-gray" ng-click="cancel()">取消</a>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <!--#include virtual="/public/inc/footer.html" -->

    <script type="text/javascript">
        seajs.use(['service/global',"service/intermediary_organ/bee/activity/info"]);
    </script>
</body>

</html>